package com.example.first;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class ScoreActivity2 extends AppCompatActivity {
    int score1 = 0;
    int score2 = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score2);
    }

    private void show1() {
        TextView show1 = findViewById(R.id.score1);
        show1.setText(String.valueOf(score1));
    }

    public void btn11(View v) {
        score1 += 1;
        show1();
    }

    public void btn12(View v) {
        score1 += 2;
        show1();
    }

    public void btn13(View v) {
        score1 += 3;
        show1();
    }

    private void show2() {
        TextView show2 = findViewById(R.id.score2);
        show2.setText(String.valueOf(score2));
    }

    public void btn21(View v) {
        score2 += 1;
        show2();
    }

    public void btn22(View v) {
        score2 += 2;
        show2();
    }

    public void btn23(View v) {
        score2 += 3;
        show2();
    }

    public void reset(View v) {
        score1 = 0;
        score2 = 0;
        show1();
        show2();
    }
}